<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MyStack.Models.StoriesView>>" %>

<asp:Content ID="Content4" ContentPlaceHolderID="HeadContentExplore" runat="server">
    <style type="text/css">
        .exploreAvatar
        {
            float: left; /*border: solid 1px Black;*/
            background-color: Black;
            height: 50px;
            width: 50px;
        }
        .exploreAvatar a
        {
            border: none;
        }
        .exploreContent
        {
            margin-left: 50px;
            padding: 0 10px 0 10px;
            min-height: 50px; /*background-color:Black;*/
            color: #848a73; 
            font-size: 1.2em;
        }
        .exploreContent a
        {
            font-weight: bold;
        }
        .explorePadding
        {
            border-top: solid 1px #decba0; /* Darker Beige Border*/
            padding: 5px 0 5px 0;
        }
        #exploreTitle
        {
            padding-bottom: 10px;
            padding-top: 20px;
        }
        #exploreTitle a
        {
            color: #7a7368; /* Dark Grey Title color */
            font-weight: bolder;
            font-size: 1.5em;
        }
        #exploreBox
        {
            overflow: auto;
            height: 550px;
            border-top: solid 2px #7a7368;
            border-bottom: solid 2px #7a7368;
            padding-left: 1em;
            padding-right: 1em;
            clear: both;
        }
        #Popular
        {
            padding: 10px 0 10px 0;
        }
        #Popular a
        {
            font-weight: bold;
            font-size: 1.5em;
            color: #75bce7; 
        }
    </style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Explore
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <!-- Explore Information -->
    <div id="pageTitleArea">
        <div id="exploreBoxTitle">
            Explore Recent Stories.</div>
        <div id="pushSuggestionText">
            Want to add something? Why not
            <%= Html.ActionLink("Push", "Push", "Stack") %>
            a new story onto your stack!</div>
    </div>
    <div id="exploreBox">
        <% int i = 0;
           foreach (var item in Model)
           { %>
        <div id="exploreTitle">
            <%= Html.ActionLink(item.Title, "Pop", "Stack", new { storyid = item.StoryId }, null)%></div>
        <div class="explorePadding">
            <div class="exploreAvatar">
                <a href="/Stack/Current/<%= item.ActingUserId%>">
                    <img alt="avatar" onload="imageResize(50, 'actingUser<%=i%>');" title="View <%= item.ActingUser.Trim()%>'s stack" id="actingUser<%=i%>"
                        src='<%= Url.Action("Show", "Image", new { id=item.ActingUserId }) %>' />
                </a>
            </div>
            <div class="exploreContent">
                <%= Html.Encode(item.Action)%>
                by
                <%= Html.ActionLink(item.ActingUser, "Current", "Stack", new { id = item.ActingUserId }, null)%>
            </div>
        </div>
        <% if (item.Action == "Popped")
           { %>
        <div class="explorePadding">
            <div class="exploreAvatar">
                <a href="/Stack/Current/<%= item.SourceUserId%>">
                    <img alt="avatar" onload="imageResize(50, 'sourceUser<%=i%>');" id="sourceUser<%=i%>"
                        src='<%= Url.Action("Show", "Image", new { id=item.SourceUserId }) %>' 
                        title="View <%= item.SourceUser.Trim()%>'s stack"/>
                </a>
            </div>
            <div class="exploreContent">
                from
                <%= Html.ActionLink(item.SourceUser, "Current", "Stack", new { id = item.SourceUserId }, null)%>'s
                Stack.
            </div>
        </div>
        <div class="explorePadding">
            <div class="exploreAvatar">
                <a href="/Stack/Current/<%= item.AuthorId %>">
                    <img alt="avatar" onload="imageResize(50, 'author<%=i%>');" id="author<%=i%>" src='<%= Url.Action("Show", "Image", new { id=item.AuthorId }) %>'
                     title="View <%= item.Author.Trim()%>'s stack"/>
                </a>
            </div>
            <div class="exploreContent">
                Written by
                <%= Html.ActionLink(item.Author, "Current", "Stack", new { id = item.AuthorId }, null)%>
            </div>
        </div>
        <% 
            }%>
        <div class="explorePadding">
        </div>
        <%
           i++;
           } %>
    </div>
</asp:Content>
